package com.itheima.io.inputstream.demo01;

import java.io.*;

public class InputStreamDemo01 {

    public static void main(String[] args) throws IOException {

        OutputStream outputStream = new FileOutputStream("itheima-io-inputstream\\a.text");
        outputStream.write("helloworldjava".getBytes());

        InputStream inputStream = new FileInputStream("itheima-io-inputstream\\a.text");

//        int read = inputStream.read();
//        while (read != -1){
//            System.out.print((char)read);
//            read = inputStream.read();
//        }
        System.out.println("----------------------");

//        int by = -1;
//        while ((by = inputStream.read()) != -1){
//            System.out.print((char) by);
//        }

        System.out.println("----------------------");
        //?????????出来的结果不对
        while (inputStream.read() != -1){
            System.out.print((char)(inputStream.read()));
        }

        inputStream.close();

    }
}
